{template mainhead}

<div id="root_middleright">

<!--{if $webglobal['action']=='user'}-->

	<dl class="my_form">
		<dt>客户预定列表</dt>
	</dl>
	<div class="searchbar autoclear">
		<form id="searchform" method="get" action="{WEBURLPATH}/{$webserver['curfilename']}.php">
			<input type="hidden" name="action" value="{$webglobal['action']}" />
			<span class="right"><button type="submit">搜索</button></span>
			<!--{if !empty($webglobal['pinfo'])}-->
				<select id="search_pid" name="pid">
					<option value="0">--- 所有活动 ---</option>
					<option value="{$webglobal['CPP']['pid']}" selected="selected">{$webglobal['pinfo']['title']}</option>
				</select>
				<!--{if !empty($webglobal['sinfo'])}-->
					<select id="search_sid" name="sid">
						<option value="0">--- 所有场所 ---</option>
						<!--{loop $webglobal['sinfo'] $tempvalue}-->
							<option value="{$tempvalue['id']}">{$tempvalue['sitename']}</option>
						<!--{/loop}-->
					</select>
					<script type="text/javascript">$("#search_sid").val({$webglobal['CPP']['sid']});</script>
				<!--{/if}-->
			<!--{else}-->
				<input type="hidden" name="pid" value="0" />
			<!--{/if}-->
			<select id="search_status" name="status">
				<option value="0">预定用户</option>
				<option value="1">激活未预定</option>
			</select>
			<script type="text/javascript">$("#search_status").val({$webglobal['CPP']['status']});</script>
			<span>关键字：</span><input type="text" name="searchkey" value="{$webglobal['CPP']['searchkey']}" size="{if !empty($webglobal['pinfo'])}20{else}50{/if}" />
		</form>
	</div>
	<form id="listform" method="post" action="{WEBURLPATH}/{$webserver['curfilename']}.php">
		<input type="hidden" name="action" id="listform_action" value="{$webglobal['action']}" />
		<input type="hidden" name="doit" value="1" />
		<input type="hidden" name="gourl" value="{$webglobal['gourl']}" />
		<table class="datatable">
			<thead>
				<th width="5%">ID</th>
				<th width="8%">姓名</th>
				<th width="20%">联系方式</th>
				<th width="17%">信息</th>
				<th width="5%">人数</th>
				<th width="20%">活动</th>
				<th width="20%">时间</th>
				<th width="5%">管理</th>
			</thead>
			<tbody>
				<!--{if $webglobal['datanum']>0}-->
					<!--{eval $i=0;}-->
					<!--{loop $webglobal['dataarray'] $tempkey $tempvalue}-->
						<tr{if intval(++$i%2)==0} class="evenrow"{/if}>
							<td>{$tempvalue['id']}</td>
							<td>{$tempvalue['truename']}</td>
							<td>
								邮箱：{$tempvalue['email']}<br />
								电话：{$tempvalue['mobile']}
							</td>
							<td>
								验证码：{$tempvalue['code']}<br />
								婚期：{$tempvalue['weddingdate_show']}
							</td>
							<td>{$tempvalue['peoplenum']}</td>
							<td>
								活动：{$tempvalue['title']}<br />
								<!--{if !empty($tempvalue['sitename'])}-->场所：{$tempvalue['sitename']}<!--{/if}-->
							</td>
							<td>
								激活：{$tempvalue['codetime_show']}<br />
								<!--{if $tempvalue['addtime_show']!=''}-->预定：{$tempvalue['addtime_show']}<!--{/if}-->
							</td>
							<td>
								<!--{if $tempvalue['peoplenum']>0}-->
									<a href="javascript:void(0)" onclick="ConfirmGoUrl('确认清除用户预定信息？','{WEBURLPATH}/{$webserver['curfilename']}.php?action=userdel&doit=1&id={$tempvalue['id']}&gourl={$webglobal['gourlencode']}')">[清除]</a>
								<!--{else}-->
									<a href="javascript:void(0)" onclick="ConfirmGoUrl('确认删除用户激活信息？','{WEBURLPATH}/{$webserver['curfilename']}.php?action=userdel&doit=1&id={$tempvalue['id']}&gourl={$webglobal['gourlencode']}')">[删除]</a>
								<!--{/if}-->
							</td>
						</tr>
					<!--{/loop}-->
				<!--{else}-->
					<tr><td colspan="20" style="text-align: center">没有符合条件的数据。</td></tr>
				<!--{/if}-->
			</tbody>
			<!--{if $webglobal['datanum']>0}-->
			<tfoot>
				<tr>
					<td colspan="3" style="text-align:left;">
						&nbsp;
					</td>
					<td colspan="10">
						<select id="list_perpage" name="perpage" onchange="window.location.href='{WEBURLPATH}/{$webserver['curfilename']}.php?{$webglobal['searchurl']}&perpage='+this.options[selectedIndex].value">
							<option value="10">每页10条</option>
							<option value="20">每页20条</option>
							<option value="30">每页30条</option>
							<option value="50">每页50条</option>
						</select>
						<script type="text/javascript">
							$("#list_perpage").val({$webglobal['CPP']['perpage']});
						</script>
					</td>
				</tr>
			</tfoot>
			<!--{/if}-->
		</table>
	</form>
	<!--{if $webglobal['datanum']>0}-->{template page}<!--{/if}-->

<!--{elseif $webglobal['action']=='site'}-->

	<dl class="my_form">
		<dt>
			<span class="right"><button type="button" onclick="javascript:location.href='{WEBURLPATH}/{$webserver['curfilename']}.php?action=list'">返回</button></span>
			<a class="cur" href="{WEBURLPATH}/{$webserver['curfilename']}.php?action=site&pid={$webglobal['pid']}">活动ID:{$webglobal['pid']}的场所列表</a>
			<a href="{WEBURLPATH}/{$webserver['curfilename']}.php?action=siteadd&pid={$webglobal['pid']}">添加新场所</a>
			<div class="fcnsmall fdark padding5">活动名称：{$webglobal['pinfo']['title']}</div>
		</dt>
	</dl>
	<form id="listform" method="post" action="{WEBURLPATH}/{$webserver['curfilename']}.php">
		<input type="hidden" name="action" id="listform_action" value="{$webglobal['action']}" />
		<input type="hidden" name="pid" value="{$webglobal['pid']}" />
		<input type="hidden" name="doit" value="1" />
		<input type="hidden" name="gourl" value="{$webglobal['gourl']}" />
		<table class="datatable">
			<thead>
				<th width="5%">ID</th>
				<th width="20%">封面图片</th>
				<th width="55%">场所信息</th>
				<th width="20%">操作</th>
			</thead>
			<tbody>
				<!--{if $webglobal['datanum']>0}-->
					<!--{eval $i=0;}-->
					<!--{loop $webglobal['dataarray'] $tempkey $tempvalue}-->
						<tr{if intval(++$i%2)==0} class="evenrow"{/if}>
							<td>{$tempvalue['id']}</td>
							<td><!--{if !empty($tempvalue['coverimg'])}--><img src="{$webconfig['webimageurl']}{$tempvalue['coverimg']}" alt="" height="120px" /><!--{/if}--></td>
							<td>
								<b>{$tempvalue['sitename']}</b><br />
								城市：{$tempvalue['city']}<br />
								地址：{$tempvalue['address']}<br />
								电话：{$tempvalue['telephone']}<br />
								时间：{$tempvalue['begintime_show']}<br />
								最大人数：{$tempvalue['maxpeoplenum']}&nbsp;已报名数：{$tempvalue['curpeoplenum']}
							</td>
							<td>
								<a href="{WEBURLPATH}/{$webserver['curfilename']}.php?action=siteedit&pid={$webglobal['pid']}&sid={$tempvalue['id']}">[编辑]</a>&nbsp;&nbsp;
								<a href="javascript:void(0)" onclick="ConfirmGoUrl('确认删除？','{WEBURLPATH}/{$webserver['curfilename']}.php?action=sitedel&doit=1&pid={$webglobal['pid']}&sid={$tempvalue['id']}')">[删除]</a>&nbsp;&nbsp;
								<a href="{WEBURLPATH}/{$webserver['curfilename']}.php?action=user&pid={$webglobal['pid']}&sid={$tempvalue['id']}" target="_blank">[用户]</a>
							</td>
						</tr>
					<!--{/loop}-->
				<!--{else}-->
					<tr><td colspan="20" style="text-align: center">没有符合条件的数据。</td></tr>
				<!--{/if}-->
			</tbody>
		</table>
	</form>

<!--{elseif $webglobal['action']=='siteadd'}-->

	<script type="text/javascript" src="{WEBURLPATH}/editor/editor_config.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/editor/editor_all_min.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/js/swfupload/swfupload.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/js/swfupload/album.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/js/datepicker/WdatePicker.js"></script>
	<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
	<form id="submitform" method="post" action="{WEBURLPATH}/{$webserver['curfilename']}.php" onsubmit="return(CheckForm('submitform'));">
		<input type="hidden" name="pid" value="{$webglobal['pid']}" />
		<input type="hidden" name="action" value="{$webglobal['action']}" />
		<input type="hidden" name="doit" value="1" />
		<dl class="my_form">
			<dt>
				<span class="right"><button type="button" onclick="javascript:location.href='{WEBURLPATH}/{$webserver['curfilename']}.php?action=list'">返回</button></span>
				<a href="{WEBURLPATH}/{$webserver['curfilename']}.php?action=site&pid={$webglobal['pid']}">活动ID:{$webglobal['pid']}的场所列表</a>
				<a class="cur" href="{WEBURLPATH}/{$webserver['curfilename']}.php?action=siteadd&pid={$webglobal['pid']}">添加新场所</a>
				<div class="fcnsmall fdark padding5">活动名称：{$webglobal['pinfo']['title']}</div>
			</dt>
			<dd>
				<label class="isneed">地点名称</label>
				<input type="text" name="sitename" size="50" value="" />
			</dd>
			<dd>
				<label class="isneed">活动时间</label>
				<input type="text" name="begintime" size="50" value="" class="Wdate" onFocus="WdatePicker({startDate:'%y-%M-%d 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',qsEnabled:false})" />
			</dd>
			<dd>
				<label class="isneed">活动城市</label>
				<input type="text" name="city" id="city" size="50" value="" />
			</dd>
			<dd>
				<label class="isneed">活动具体地址</label>
				<input type="text" name="address" id="address" size="50" value="" />
			</dd>
			<dd>
				<label class="isneed">google地图位置</label>
				<!-- latitude 纬度,longitude 经度 -->
				<input type="hidden" name="latitude" id="input_latitude" value="0" />
				<input type="hidden" name="longitude" id="input_longitude" value="0" />
				<button type="button" class="btdark" onclick="mark_map();" id="mark_map_button">标注新坐标</button>&nbsp;<button type="button" class="btdark" onclick="mark_clear();" id="mark_clear_button" style="display:none;">清除新坐标</button>
				&nbsp;<span id="mark_map_info_new"></span>
				<div id="map_canvas_edit" style="width:200px; height:100px; display: none;"></div>
				<script type="text/javascript">
					var cur_latitude = 0;
					var cur_longitude = 0;
					var cur_latlng = new google.maps.LatLng(cur_latitude, cur_longitude);
					var cur_default_latlng = new google.maps.LatLng(35.22354439383212, 103.93229484558105);
					var cur_default_zoom = 4;
					var map;
					var new_marker;
					function map_initialize(latlng, zoom)
					{
						$("#map_canvas_edit").show();
						var myOptions = {
								zoom: zoom,
								center: latlng,
								mapTypeControl: false,
								//navigationControl: false,
								streetViewControl: false,
								mapTypeId: google.maps.MapTypeId.ROADMAP
							};
						map = new google.maps.Map(document.getElementById("map_canvas_edit"), myOptions);
					}
					function show_map()
					{
						if (cur_latitude!=0 || cur_longitude!=0)
						{
							map_initialize(cur_latlng, 16);
							var cur_marker = new google.maps.Marker({map: map, position: cur_latlng, icon: WEBURLPATH+'/images/mapflag.png'});
						}
					}
					function mark_map()
					{
						$("#map_canvas_edit").width(600).height(400);
						if (cur_latitude==0 && cur_longitude==0)
						{
							map_initialize(cur_default_latlng, cur_default_zoom);
							codeAddress();
						}
						else
						{
							show_map();
						}
						google.maps.event.addListener(map, 'click', function(event){addMarker(event.latLng);});
						mark_clear();
						$("#mark_map_info_new").html('(点击地图设定新坐标)');
					}
					function addMarker(location)
					{
						if (new_marker)
						{
							new_marker.setMap(null);
						}
						var new_latitude = location.lat();
						var new_longitude = location.lng();
						new_marker = new google.maps.Marker({position: location,map: map});
						$("#input_latitude").val(new_latitude);
						$("#input_longitude").val(new_longitude);
						$("#mark_clear_button").show();
						$("#mark_map_info_new").html('(新坐标 纬度：'+new_latitude+'，经度：'+new_longitude+')');
					}
					function mark_clear()
					{
						if (new_marker)
						{
							new_marker.setMap(null);
						}
						$("#input_latitude").val(cur_latitude);
						$("#input_longitude").val(cur_longitude);
						$("#mark_clear_button").hide();
						$("#mark_map_info_new").html('');
					}
					function codeAddress()
					{
						var address = $('#city').val()+$('#address').val();
						if (address == '')
						{
							return;
						}
						var geocoder = new google.maps.Geocoder();
						geocoder.geocode({'address': address}, function(results, status) {
							if (status == google.maps.GeocoderStatus.OK)
							{
								map.setCenter(results[0].geometry.location);
								map.setZoom(16);
								var search_marker = new google.maps.Marker({
												map: map, 
												position: results[0].geometry.location,
												icon: WEBURLPATH+'/images/mapflag.png'
											});
								var infowindow = new google.maps.InfoWindow({maxWidth: 200, content: '系统根据当前地址模糊定位到此，请点击地图设定确切位置，只有点击后设定才生效，当前标记仅作参考。'});
								infowindow.open(map, search_marker);
							}
						});
					}
					$(document).ready(show_map());
				</script>
				<!-- http://code.google.com/intl/zh-CN/apis/maps/documentation/javascript/reference.html -->
			</dd>
			<dd>
				<label class="isneed">联系电话</label>
				<input type="text" name="telephone" size="50" value="" />
			</dd>
			<dd>
				<label class="isneed">设定人数</label>
				<input type="text" name="maxpeoplenum" size="50" value="" />
			</dd>
			<dd>
				<label>简要介绍</label>
				<textarea name="info" rows="3" cols="50"></textarea>
			</dd>
			<dd>
				<label>相册</label>
				<div>
					<span class="flashbutton"><span id="albumup_button_topic"></span></span>
					<span id="albumup_progress_topic" class="flashbutton_progress"></span>
				</div>
				<div id="albumup_thumb_topic"></div>
				<script type="text/javascript">SetAlbumUpload('topic');</script>
			</dd>
			<dd class="my_form_btn"><button type="submit" name="submit" value="ok">确&nbsp;&nbsp;定</button></dd>
		</dl>
	</form>

<!--{elseif $webglobal['action']=='siteedit'}-->

	<script type="text/javascript" src="{WEBURLPATH}/editor/editor_config.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/editor/editor_all_min.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/js/swfupload/swfupload.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/js/swfupload/album.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/js/datepicker/WdatePicker.js"></script>
	<script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
	<form id="submitform" method="post" action="{WEBURLPATH}/{$webserver['curfilename']}.php" onsubmit="return(CheckForm('submitform'));">
		<input type="hidden" name="pid" value="{$webglobal['pid']}" />
		<input type="hidden" name="sid" value="{$webglobal['sid']}" />
		<input type="hidden" name="action" value="{$webglobal['action']}" />
		<input type="hidden" name="doit" value="1" />
		<dl class="my_form">
			<dt>
				<span class="right"><button type="button" onclick="javascript:location.href='{WEBURLPATH}/{$webserver['curfilename']}.php?action=site&pid={$webglobal['pid']}'">返回</button></span>
				编辑活动场所信息
			</dt>
			<dd>
				<label class="isneed">地点名称</label>
				<input type="text" name="sitename" size="50" value="{$webglobal['datainfo']['sitename']}" />
			</dd>
			<dd>
				<label class="isneed">活动时间</label>
				<input type="text" name="begintime" size="50" value="{$webglobal['datainfo']['begintime_show']}" class="Wdate" onFocus="WdatePicker({startDate:'%y-%M-%d 00:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss',qsEnabled:false})" />
			</dd>
			<dd>
				<label class="isneed">活动城市</label>
				<input type="text" name="city" id="city" size="50" value="{$webglobal['datainfo']['city']}" />
			</dd>
			<dd>
				<label class="isneed">活动具体地址</label>
				<input type="text" name="address" id="address" size="50" value="{$webglobal['datainfo']['address']}" />
			</dd>
			<dd>
				<label class="isneed">google地图位置</label>
				<!-- latitude 纬度,longitude 经度 -->
				<input type="hidden" name="latitude" id="input_latitude" value="{$webglobal['datainfo']['latitude']}" />
				<input type="hidden" name="longitude" id="input_longitude" value="{$webglobal['datainfo']['longitude']}" />
				<button type="button" class="btdark" onclick="mark_map();" id="mark_map_button">标注新坐标</button>&nbsp;
				<!--{if $webglobal['datainfo']['latitude']!=0 || $webglobal['datainfo']['latitude']!=0}-->
					&nbsp;<span id="mark_map_info">(已设定 纬度：{$webglobal['datainfo']['latitude']}，经度：{$webglobal['datainfo']['longitude']})</span><br /><br />
				<!--{/if}-->
				<button type="button" class="btdark" onclick="mark_clear();" id="mark_clear_button" style="display:none;">清除新坐标</button>
				&nbsp;<span id="mark_map_info_new"></span>
				<div id="map_canvas_edit" style="width:200px; height:100px; display: none;"></div>
				<script type="text/javascript">
					var cur_latitude = {$webglobal['datainfo']['latitude']};
					var cur_longitude = {$webglobal['datainfo']['longitude']};
					var cur_latlng = new google.maps.LatLng(cur_latitude, cur_longitude);
					var cur_default_latlng = new google.maps.LatLng(35.22354439383212, 103.93229484558105);
					var cur_default_zoom = 4;
					var map;
					var new_marker;
					function map_initialize(latlng, zoom)
					{
						$("#map_canvas_edit").show();
						var myOptions = {
								zoom: zoom,
								center: latlng,
								mapTypeControl: false,
								//navigationControl: false,
								streetViewControl: false,
								mapTypeId: google.maps.MapTypeId.ROADMAP
							};
						map = new google.maps.Map(document.getElementById("map_canvas_edit"), myOptions);
					}
					function show_map()
					{
						if (cur_latitude!=0 || cur_longitude!=0)
						{
							map_initialize(cur_latlng, 16);
							var cur_marker = new google.maps.Marker({map: map, position: cur_latlng, icon: WEBURLPATH+'/images/mapflag.png'});
						}
					}
					function mark_map()
					{
						$("#map_canvas_edit").width(600).height(400);
						if (cur_latitude==0 && cur_longitude==0)
						{
							map_initialize(cur_default_latlng, cur_default_zoom);
							codeAddress();
						}
						else
						{
							show_map();
						}
						google.maps.event.addListener(map, 'click', function(event){addMarker(event.latLng);});
						mark_clear();
						$("#mark_map_info_new").html('(点击地图设定新坐标)');
					}
					function addMarker(location)
					{
						if (new_marker)
						{
							new_marker.setMap(null);
						}
						var new_latitude = location.lat();
						var new_longitude = location.lng();
						new_marker = new google.maps.Marker({position: location,map: map});
						$("#input_latitude").val(new_latitude);
						$("#input_longitude").val(new_longitude);
						$("#mark_clear_button").show();
						$("#mark_map_info_new").html('(新坐标 纬度：'+new_latitude+'，经度：'+new_longitude+')');
					}
					function mark_clear()
					{
						if (new_marker)
						{
							new_marker.setMap(null);
						}
						$("#input_latitude").val(cur_latitude);
						$("#input_longitude").val(cur_longitude);
						$("#mark_clear_button").hide();
						$("#mark_map_info_new").html('');
					}
					function codeAddress()
					{
						var address = $('#city').val()+$('#address').val();
						if (address == '')
						{
							return;
						}
						var geocoder = new google.maps.Geocoder();
						geocoder.geocode({'address': address}, function(results, status) {
							if (status == google.maps.GeocoderStatus.OK)
							{
								map.setCenter(results[0].geometry.location);
								map.setZoom(16);
								var search_marker = new google.maps.Marker({
												map: map, 
												position: results[0].geometry.location,
												icon: WEBURLPATH+'/images/mapflag.png'
											});
								var infowindow = new google.maps.InfoWindow({maxWidth: 200, content: '系统根据当前地址模糊定位到此，请点击地图设定确切位置，只有点击后设定才生效，当前标记仅作参考。'});
								infowindow.open(map, search_marker);
							}
						});
					}
					$(document).ready(show_map());
				</script>
				<!-- http://code.google.com/intl/zh-CN/apis/maps/documentation/javascript/reference.html -->
			</dd>
			<dd>
				<label class="isneed">联系电话</label>
				<input type="text" name="telephone" size="50" value="{$webglobal['datainfo']['telephone']}" />
			</dd>
			<dd>
				<label class="isneed">设定人数</label>
				<input type="text" name="maxpeoplenum" size="50" value="{$webglobal['datainfo']['maxpeoplenum']}" />
			</dd>
			<dd>
				<label>简要介绍</label>
				<textarea name="info" rows="3" cols="50">{$webglobal['datainfo']['info']}</textarea>
			</dd>
			<dd>
				<label>相册</label>
				<div>
					<span class="flashbutton"><span id="albumup_button_topic"></span></span>
					<span id="albumup_progress_topic" class="flashbutton_progress"></span>
				</div>
				<div id="albumup_thumb_topic">
					<!--{loop $webglobal['datainfo_image'] $tempvalue}-->
						<span class="albumup_thumb">
							<a onclick="delFlashImage(this, 'topic');" href="javascript:void(0);"><img alt="" src="{WEBURLPATH}/images/delpic.gif"></a>
							<img src="{WEBURLPATH}/showimage.php?w=140&h=140&f={$tempvalue['f']}" alt="" /><br />
							<input type="hidden" value="{$tempvalue['imgfile']}" name="topic_input_name[{$tempvalue['id']}]" />
							<input type="hidden" value="0" name="topic_input_rate[{$tempvalue['id']}]" />
							描述：<input type="text" size="12" value="{$tempvalue['imginfo']}" name="topic_input_info[{$tempvalue['id']}]" /><br />
							排序：<input type="text" size="3" value="{$tempvalue['imgorder']}" name="topic_input_order[{$tempvalue['id']}]" />&nbsp;封面：<input type="radio" value="{$tempvalue['id']}" name="topic_input_cover"{if $tempvalue['imgfile']==$webglobal['datainfo']['coverimg']} checked="checked"{/if} />
						</span>
					<!--{/loop}-->
				</div>
				<script type="text/javascript">SetAlbumUpload('topic');albumobj['topic_idcount'] = {$webglobal['imagemaxid']};</script>
			</dd>
			<dd class="my_form_btn"><button type="submit" name="submit" value="ok">确&nbsp;&nbsp;定</button></dd>
		</dl>
	</form>

<!--{elseif $webglobal['action']=='add'}-->

	<script type="text/javascript" src="{WEBURLPATH}/editor/editor_config.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/editor/editor_all_min.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/js/swfupload/swfupload.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/js/swfupload/album.js"></script>
	<form id="topicform" method="post" action="{WEBURLPATH}/{$webserver['curfilename']}.php" onsubmit="return(CheckForm('topicform'));">
		<input type="hidden" name="action" value="{$webglobal['action']}" />
		<input type="hidden" name="doit" value="1" />
		<dl class="my_form">
			<dt>发布活动</dt>
			<dd>
				<label class="isneed">标题</label>
				<input type="text" name="title" size="50" value="" />
			</dd>
			<dd>
				<label class="isneed">礼品图片</label>
				<div>
					<span class="flashbutton"><span id="albumup_button_cover"></span></span>
					<span id="albumup_progress_cover" class="flashbutton_progress"></span>
				</div>
				<div id="albumup_thumb_cover"></div>
				<script type="text/javascript">SetAlbumUpload('cover', 1);</script>
			</dd>
			<dd>
				<label class="isneed">礼品介绍</label>
				<textarea name="giftinfo" rows="3" cols="50"></textarea>
			</dd>
			<dd>
				<label class="isneed">活动展示图片</label>
				<div>
					<span class="flashbutton"><span id="albumup_button_cover1"></span></span>
					<span id="albumup_progress_cover1" class="flashbutton_progress"></span>
				</div>
				<div id="albumup_thumb_cover1"></div>
				<script type="text/javascript">SetAlbumUpload('cover1', 1);</script>
			</dd>
			<dd>
				<label class="isneed">活动详情<span>插入 分页 分割序言和内容，#limitdate# 代表限定时间</span></label>
				<script type="text/plain" id="content" name="content"></script>
				<script type="text/javascript">UE.getEditor('content');</script>
			</dd>
			<dd class="my_form_btn"><button type="submit" name="submit" value="ok">确&nbsp;&nbsp;定</button></dd>
		</dl>
	</form>

<!--{elseif $webglobal['action']=='edit'}-->

	<script type="text/javascript" src="{WEBURLPATH}/editor/editor_config.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/editor/editor_all_min.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/js/swfupload/swfupload.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/js/swfupload/album.js"></script>
	<form id="topicform" method="post" action="{WEBURLPATH}/{$webserver['curfilename']}.php" onsubmit="return(CheckForm('topicform'));">
		<input type="hidden" name="action" value="{$webglobal['action']}" />
		<input type="hidden" name="doit" value="1" />
		<input type="hidden" name="gourl" value="{$webglobal['gourl']}" />
		<input type="hidden" name="id" value="{$webglobal['id']}" />
		<dl class="my_form">
			<dt>
				<span class="right"><button type="button" onclick="javascript:location.href='{WEBURLPATH}/{$webserver['curfilename']}.php?{$webglobal['gourl']}'">返回</button></span>
				编辑活动 ID:{$webglobal['id']}
			</dt>
			<dd>
				<label class="isneed">标题</label>
				<input type="text" name="title" size="50" value="{$webglobal['datainfo']['title']}" />
			</dd>
			<dd>
				<label class="isneed">礼品图片</label>
				<div>
					<span class="flashbutton"><span id="albumup_button_cover"></span></span>
					<span id="albumup_progress_cover" class="flashbutton_progress"></span>
				</div>
				<div id="albumup_thumb_cover">
					<!--{if !empty($webglobal['datainfo']['gifpic_show'])}-->
						<span id="albumup_thumb_id_cover" class="albumup_thumb">
							<a onclick="delFlashImage(this, 'cover');" href="javascript:void(0);"><img alt="" src="{WEBURLPATH}/images/delpic.gif"></a>
							<img src="{WEBURLPATH}/showimage.php?w=200&h=100&f={$webglobal['datainfo']['gifpic_show']}" alt="" />
							<input type="hidden" value="{$webglobal['datainfo']['gifpic']}" name="cover_input_name">
						</span>
					<!--{/if}-->
				</div>
				<script type="text/javascript">SetAlbumUpload('cover', 1);</script>
			</dd>
			<dd>
				<label class="isneed">礼品介绍</label>
				<textarea name="giftinfo" rows="3" cols="50">{$webglobal['datainfo']['giftinfo']}</textarea>
			</dd>
			<dd>
				<label class="isneed">活动展示图片</label>
				<div>
					<span class="flashbutton"><span id="albumup_button_cover1"></span></span>
					<span id="albumup_progress_cover1" class="flashbutton_progress"></span>
				</div>
				<div id="albumup_thumb_cover1">
					<!--{if !empty($webglobal['datainfo']['showimg_show'])}-->
						<span id="albumup_thumb_id_cover1" class="albumup_thumb">
							<a onclick="delFlashImage(this, 'cover1');" href="javascript:void(0);"><img alt="" src="{WEBURLPATH}/images/delpic.gif"></a>
							<img src="{WEBURLPATH}/showimage.php?w=200&h=100&f={$webglobal['datainfo']['showimg_show']}" alt="" />
							<input type="hidden" value="{$webglobal['datainfo']['showimg']}" name="cover1_input_name">
						</span>
					<!--{/if}-->
				</div>
				<script type="text/javascript">SetAlbumUpload('cover1', 1);</script>
			</dd>
			<dd>
				<label class="isneed">活动详情<span>插入 分页 分割序言和内容，#limitdate# 代表限定时间</span></label>
				<script type="text/plain" id="content" name="content">{$webglobal['datainfo']['content']}</script>
				<script type="text/javascript">UE.getEditor('content');</script>
			</dd>
			<dd class="my_form_btn"><button type="submit" name="submit" value="ok">确&nbsp;&nbsp;定</button></dd>
		</dl>
	</form>

<!--{elseif $webglobal['action']=='list'}-->

	<dl class="my_form">
		<dt>活动信息列表</dt>
	</dl>
	<div class="searchbar autoclear">
		<form id="searchform" method="get" action="{WEBURLPATH}/{$webserver['curfilename']}.php">
			<input type="hidden" name="action" value="{$webglobal['action']}" />
			<span class="right"><button type="submit">搜索</button></span>
			<span>关键字：</span><input type="text" name="searchkey" value="{$webglobal['CPP']['searchkey']}" size="50" />
		</form>
	</div>
	<form id="listform" method="post" action="{WEBURLPATH}/{$webserver['curfilename']}.php">
		<input type="hidden" name="action" id="listform_action" value="{$webglobal['action']}" />
		<input type="hidden" name="doit" value="1" />
		<input type="hidden" name="gourl" value="{$webglobal['gourl']}" />
		<table class="datatable">
			<thead>
				<th width="5%">&nbsp;</th>
				<th width="5%">ID</th>
				<th width="20%">礼品</th>
				<th width="50%">标题</th>
				<th width="20%">操作</th>
			</thead>
			<tbody>
				<!--{if $webglobal['datanum']>0}-->
					<!--{eval $i=0;}-->
					<!--{loop $webglobal['dataarray'] $tempkey $tempvalue}-->
						<tr{if intval(++$i%2)==0} class="evenrow"{/if}>
							<td><input type="checkbox" name="checkid[]" value="{$tempvalue['id']}" class="noborder" /></td>
							<td>{$tempvalue['id']}</td>
							<td><img src="{$webconfig['webimageurl']}{$tempvalue['gifpic']}" alt="" height="50px" /></td>
							<td>{$tempvalue['title']}</td>
							<td>
								<a href="{WEBURLPATH}/{$webserver['curfilename']}.php?action=edit&id={$tempvalue['id']}&gourl={$webglobal['gourlencode']}">[编辑]</a>&nbsp;&nbsp;
								<a href="{WEBURLPATH}/{$webserver['curfilename']}.php?action=site&pid={$tempvalue['id']}&gourl={$webglobal['gourlencode']}">[场所]</a>&nbsp;&nbsp;
								<a href="{WEBURLPATH}/{$webserver['curfilename']}.php?action=user&pid={$tempvalue['id']}" target="_blank">[用户]</a>
							</td>
						</tr>
					<!--{/loop}-->
				<!--{else}-->
					<tr><td colspan="20" style="text-align: center">没有符合条件的数据。</td></tr>
				<!--{/if}-->
			</tbody>
			<!--{if $webglobal['datanum']>0}-->
			<tfoot>
				<tr>
					<td colspan="3" style="text-align:left;">
							<input type="checkbox" class="noborder" id="list_select_all" name="list_select_all" value="1" onclick="$('#listform *[name=\'checkid[]\']').attr('checked', $(this).attr('checked') ? true : false);" /><label for="list_select_all">全选</label>&nbsp;
							<button type="button" onclick="if(confirm('确定删除选中活动？')){$('#listform_action').val('del');$('#listform').submit();}else{return;}">删除</button>
					</td>
					<td colspan="5">
						<select id="list_perpage" name="perpage" onchange="window.location.href='{WEBURLPATH}/{$webserver['curfilename']}.php?{$webglobal['searchurl']}&perpage='+this.options[selectedIndex].value">
							<option value="10">每页10条</option>
							<option value="20">每页20条</option>
							<option value="30">每页30条</option>
							<option value="50">每页50条</option>
						</select>
						<script type="text/javascript">
							$("#list_perpage").val({$webglobal['CPP']['perpage']});
						</script>
					</td>
				</tr>
			</tfoot>
			<!--{/if}-->
		</table>
	</form>
	<!--{if $webglobal['datanum']>0}-->{template page}<!--{/if}-->

<!--{/if}-->

</div>
{template footer}